package com.jacken.springcloudbank02.service.impl;

import com.jacken.springcloudbank02.entity.SysLog;
import com.jacken.springcloudbank02.mapper.SysLogMapper;
import com.jacken.springcloudbank02.service.ISysLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @author wangqiang
 * @version 1.0
 * @date 2020/10/18 11:10
 */
@Service
public class ISysLogServiceImpl implements ISysLogService {


    @Resource
    private SysLogMapper sysLogMapper;

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW)  //挂起之前的事务  新建一个事务
    public void saveLog(SysLog sysLog) {
        sysLogMapper.insert(sysLog);
    }
}
